package com.levi.pojo;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import java.math.BigDecimal;

/**
 * @author shentong
 * @since 2022/3/29 9:23 PM
 */
@Data
@TableName("mall_product")
@ApiModel("商品实体类")
public class Product extends BaseEntity{

    @TableId(value = "id",type = IdType.AUTO)
    private Integer id;

    @TableField("category_id")
    @ApiModelProperty("商品分类")
    private Integer categoryId;

    @TableField("name")
    @ApiModelProperty("商品标题")
    private String name;

    @TableField("subtitle")
    @ApiModelProperty("商品副标题")
    private String subTitle;

    @TableField("main_image")
    @ApiModelProperty("产品主图,url相对地址")
    private String mainImage;

    @ApiModelProperty("图片地址,json格式,扩展用")
    @TableField("sub_images")
    private String subImages;

    @TableField("detail")
    @ApiModelProperty("详情")
    private String detail;

    @TableField("price")
    @ApiModelProperty("价格，单位元，保留两位小数")
    private BigDecimal price;

    @TableField("stock")
    @ApiModelProperty("库存")
    private Integer stock;

    @TableField("status")
    @ApiModelProperty("状态1-在售，2-下架，3-删除")
    private Integer status;

}
